import pickle

a1 = 'apple'
b1 = {1: 'One', 2: 'Two', 3: 'Three'}
c1 = ['fee', 'fie', 'foe', 'fum']
f1 = file('temp.pkl', 'wb')
pickle.dump(a1, f1, True)
pickle.dump(b1, f1, True)
pickle.dump(c1, f1, True)
f1.close()

f2 = file('temp.pkl', 'rb')
a2 = pickle.load(f2)
print(a2)
#'apple'

b2 = pickle.load(f2)
print(b2)
#{1: 'One', 2: 'Two', 3: 'Three'}

c2 = pickle.load(f2)
print(c2)
#['fee', 'fie', 'foe', 'fum']

f2.close()